** Replication Code for:
** Terrorism Activates Ethnocentrism to Explain Greater Willingness to 
** Sacrifice Civil Liberties: Evidence from Germany
** Authors: Christina Novak Hansen and Peter Thisted Dinesen 
** Date: 10/02/2021

*-------------------------------------------------------------------------------

clear all
use GGSS2016_analysis.dta


*-------------------------------------------------------------------------------
*Appendix I: Construction of main and alternative dependent variable 
*-------------------------------------------------------------------------------

					***I1: Civil liberties (terrorism)***

*Factor analysis
spearman st_terror1 st_terror2 st_terror3 if st_terrori!=. ///
	& st_ethno!=. & sex!=. & st_age!=. & proedu2!=. & work2!=. & treatment1!=. ///
	& german==1, stats(rho obs p)
factor st_terror1 st_terror2 st_terror3 [aweight = wghtpew] ///
	if st_terrori!=. & st_ethno!=. & sex!=. & st_age!=. & proedu2!=. ///
	& work2!=. & treatment1!=. & german==1, pcf
alphawgt st_terror1 st_terror2 st_terror3 [aweight = wghtpew] ///
	if st_terrori!=. & st_ethno!=. & sex!=. & st_age!=. ///
	& proedu2!=. & work2!=. & treatment1!=. & german==1, casewise item





					***I2: Civil liberties (general)***


*Factor analysis
spearman st_video st_email st_spyDE st_spyother if st_terrori!=. ///
	& st_ethno!=. & sex!=. & st_age!=. & proedu2!=. & work2!=. & treatment1!=. ///
	& german==1, stats(rho obs p)
factor st_video st_email st_spyDE st_spyother [aweight = wghtpew] ///
	if st_terrori!=. & st_ethno!=. & sex!=. & st_age!=. & proedu2!=. ///
	& work2!=. & treatment1!=. & german==1, pcf
alphawgt st_video st_email st_spyDE st_spyother [aweight = wghtpew] ///
	if st_terrori!=. & st_ethno!=. & sex!=. & st_age!=. ///
	& proedu2!=. & work2!=. & treatment1!=. & german==1, casewise item

